// 代码块
:root {
  --vp-code-block-bg: #282c34;
  --vp-code-block-divider-color: #2f3542;
  --vp-code-line-number-color: rgba(171, 178, 191, 0.67);
  --vp-code-copy-code-hover-bg: rgb(
    46.6326086957,
    53.1775362319,
    66.2673913043
  );
  --vp-code-copy-code-hover-border-color: rgb(
    46.6326086957,
    53.1775362319,
    66.2673913043
  );
  --vp-code-copy-code-bg: #282c34;
  --vp-code-copy-code-border-color: #282c34;
}

div[class*="language-"].line-numbers-mode:after {
  position: absolute;
  top: 0.6rem;
  left: 0.7rem;
  height: 0.75rem;
  width: 0.75rem;
  border-radius: 12px;
  content: "";
  background: #fc625d;
  box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
}

.vp-doc div[class*="language-"].line-numbers-mode .line-numbers {
  padding-top: 30px;
}

.vp-doc div[class*="language-"] pre {
  padding-top: 30px;
}

.vp-doc div[class*="language-"]::before {
  left: 5rem;
  right: auto;
  font-size: 0.7rem;
}

// 美化标题
.vp-doc {
  h4 {
    --prefix-icon: "🍁";
  }
  h5 {
    --prefix-icon: "🌸";
  }
  h6 {
    --prefix-icon: "🍂";
  }

  h2,
  h3 {
    .header-anchor:hover {
      color: #4dd0e1;
    }
  }

  h2 {
    border: none;
    .header-anchor {
      display: block;
      border-bottom: 4px solid #4dd0e1;
      position: relative;
      font-size: 24px;
      padding: 12px 32px;
      color: #4dd0e1;
      font-weight: 700;

      &::before,
      &::after {
        content: "";
        display: block;
        position: absolute;
        bottom: 0;
        opacity: 1;
      }

      &::before {
        opacity: 1;
        width: 24px;
        height: 24px;
        left: 0;
        top: 0;
        margin: auto;
        background-size: 24px 24px;
        background-image: url();
      }

      &::after {
        opacity: 1;
        right: 0;
        width: 400px;
        height: 10px;
        border-top-right-radius: 24px;
        background: linear-gradient(90deg, transparent, #4dd0e1);
        max-width: 50vw;
      }
    }
  }
  h3 {
    border: none;
    .header-anchor {
      margin: 30px 0;
      font-size: 18px;
      position: relative;
      padding: 4px 32px;
      width: max-content;
      color: #4dd0e1;
      font-weight: 700;

      &::before,
      &::after {
        opacity: 1;
        content: "";
        display: block;
        position: absolute;
        bottom: 0;
      }

      &::before {
        border-bottom: 2px solid #4dd0e1;
        width: 100%;
        content: "";
        display: block;
        height: 28px;
        position: absolute;
        left: 0;
        top: 0;
        bottom: -2px;
        margin: auto;
        background-size: 28px 28px;
        background-image: url();
        background-repeat: no-repeat;
        animation: h3AnimationBefore 2s infinite alternate;
      }

      &::after {
        content: "";
        display: block;
        width: 28px;
        height: 28px;
        position: absolute;
        border: 2px solid #4dd0e1;
        border-radius: 50%;
        right: -15px;
        top: 0;
        bottom: 0;
        margin: auto;
        background-size: 28px 28px;
        background-image: url();
        animation: h3AnimationAfter 2s infinite alternate;
      }
    }
  }

  h4,
  h5,
  h6 {
    .header-anchor {
      & > span {
        &::before {
          content: var(--prefix-icon);
        }
      }
    }
  }

  // blockquote
  blockquote {
    margin: 15px 0;
    padding: 24px 32px;
    border-left: 4px solid #26c6da;
    background: rgba(77, 208, 225, 0.15);
    position: relative;
    &::before {
      content: "❝";
      top: 8px;
      left: 8px;
      color: rgb(77, 208, 225);
      font-size: 30px;
      line-height: 1;
      font-weight: 700;
      position: absolute;
      opacity: 0.7;
    }
    &::after {
      content: "❞";
      font-size: 30px;
      position: absolute;
      right: 8px;
      bottom: 0px;
      color: rgb(77, 208, 225);
      opacity: 0.7;
    }
  }
  // code
  :not(pre) > code {
    background-color: rgba(77, 208, 225, 0.08);
    color: #26c6da;
  }

  table {
    width: 100%;
    display: table;
  }
}

.main {
  .vp-breadcrumb {
    padding: 12px 8px;
    border-color: #26c6da;
    background: rgba(77, 208, 225, 0.15);
    position: relative;

    ol {
      font-size: 16px;
    }
  }
}

.aside {
  .outline-link:hover,
  .outline-link.active {
    color: #7adce9;
  }
  .outline-marker {
    background-color: #26c6da;
  }
}

@keyframes h3AnimationBefore {
  0% {
    width: 28px;
  }

  25% {
    width: 100%;
  }
  50% {
    width: 100%;
  }
  100% {
    width: 100%;
  }
}

@keyframes h3AnimationAfter {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(-1turn);
  }

  100% {
    transform: rotate(-1turn);
  }
}

.vp-doc div[class*="language-"].has-collapsed .collapsed-lines::before {
  background: rgba($color: #ffffff, $alpha: 0.8);
}

.vp-doc .vp-tab {
  padding: 0;
  div[class*="language-"] {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}
